<?php
namespace app\index\controller;
use think\Controller;
use think\Db;
use app\common\model\AreaManager;
use app\common\model\Product;
use Tree;

class Index extends Base
{
    public function index()
    {

        $hezuo = Db::name('hezuo')->where([
            'isDelete' => 0,
            'status' => 1,
        ])->order('sort')->select();

        $adv = Db::name('adv')->where('id',1)->find();

        $zhizhao = Db::name('cert')->where([
            'isDelete' => 0,
            'status' => 1,
        ])->select();

        $banner = Db::name('banner')->where([
            'isDelete' => 0,
            'status' => 1,
        ])->select();

        $item = Db::name('questionitems')->order('sort asc')->where('status','1')->select();
        $this->assign('item',$item);

        $qK = new AreaManager();

        $quk = $qK->with('AreaItems')->order('id ASC')->select();
        $this->assign('qk',$quk);

        $this->assign('hezuo',$hezuo);
        $this->assign('adv',$adv);
        $this->assign('zhizhao',$zhizhao);
        $this->assign('banner',$banner);

        return $this->fetch();
    }


    public function about()
    {
        $about = Db::name('about')->find();
        $this->assign('about',$about);
        return $this->fetch();
    }

    public function tool()
    {

         return $this->fetch('list');
    }

}
